<?php
/**
 * Created by PhpStorm.
 * User: ycp
 * Date: 2017/4/15
 * Time: 14:33
 */

namespace Admin\Controller;


class CalendarController extends BaseController
{
    public function index()
    {
        $data = D('CourseCalendar')->search();
        foreach ($data['data'] as $k=>$v){
            $limit_num=get_sy_class($v['course_id']); //剩余课程
            $class=getClassroom($v['classroom_id']);
            $teacher=getteacher($v['teacher_id']);
            $time=date('H:i',strtotime($v['course_date']));
//            var_dump($time);
            $data['data'][$k]['limit_num_last']=$limit_num;
            $data['data'][$k]['classroom']=$class;
            $data['data'][$k]['teacher']=$teacher;
            $data['data'][$k]['time']=$time;
//            var_dump($data['data']);
        }

//        var_dump($data);exit();
        $this->assign([
            'data'=>$data['data'],
            'page'=>$data['page'],
        ]);
        $this->assign(array(
            '_page_title' => '瑜伽馆课程表'
        ));
        $this->display();
    }
}